// const SM3 = require('sm-crypto').sm3
import {sm2,sm3 } from 'sm-crypto'

//公钥
const publicKey = `04e9b8a5c7428372689272f3c5e56049110ec5e0c619d02eee5ab094e5592f1bdabfdc19ba785f2c0e756a115374c77deab5339651952d4469773813dc6556b300`
//私钥
const privateKey = ``

/*
 * 加密工具函数
 * @param {String} text 待加密文本
 */
export const sm3encrypt = (text) => {
	return sm3(text)
}


export const sm2encrypt = (text) => {
	return sm2.doEncrypt(text,publicKey,1)
}